package com.hp.ssmp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hp.ssmp.dao.CategoryMapper;
import com.hp.ssmp.dao.ReplyMapper;
import com.hp.ssmp.entity.TCommentReply;
import com.hp.ssmp.entity.TGoodsCategory;
import com.hp.ssmp.entity.dto.TGoodsCategoryDto;
import com.hp.ssmp.service.CategoryService;
import com.hp.ssmp.service.ReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Service("categoryService")
@Transactional
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, TGoodsCategory> implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;


    @Override
    public List<TGoodsCategoryDto> getList() {
        return categoryMapper.findAll();
    }

    @Override
    public List<TGoodsCategory> getLevelList(Long level) {
        if(level >3){
            return  null;
        }
        return categoryMapper.getLevelList(level);
    }
}
